package com.sfx.other.Demo;


/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: sfx
 * Date: 2023-09-04
 * Time: 15:54
 */

abstract class a{
    public a() {

    }

    abstract void bb();
}

public class Outer {

    private static final int  shared = 100;

    private  static String aaa() {
        return "";
    }
    private int x = 0;

    // 静态内部类
    private static class StaticInner{
        public void innerMethod() {
            System.out.println("inner : " + shared );
            aaa();
        }
    }

    public class NoStaticInner1{
        public void innerMethod() {
            aaa();
            System.out.println("inner : " + shared);
        }
    }

    public void test() {
        StaticInner staticInner = new StaticInner();
        staticInner.innerMethod();
    }

    public static void main(String[] args) {
        long num = 100L;
        // 1. 强制类型转换
        int res = (int) num;
        // 2. 使用Long.intValue
        Long a = 100L;
        int i = a.intValue();
        // 3. 使用Math.toIntExact
        int i1 = Math.toIntExact(num);
        String x = "";
        x += "1";

    }
}